package com.wx.chapter11.enum_;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/13 - 15:37
 */
public class EnumMethod {
    public static void main(String[] args) {
        Season2 autumn = Season2.AUTUMN;
        //获得枚举对象的名称
        System.out.println(autumn.name());
        System.out.println(autumn.ordinal());//获得枚举对象的编号
        Season2[] values = Season2.values();//获得枚举对象数组
        for (Season2 value : values) {
            System.out.println(value);
        }
        Season2 autumn1 = Season2.valueOf("AUTUMN");
        System.out.println(autumn1);
        System.out.println(Season2.AUTUMN.compareTo(Season2.AUTUMN));
    }
}